package com.example.study_manger.repository;


import com.example.study_manger.entity.Exam;
import com.example.study_manger.entity.Organization;
import com.example.study_manger.entity.UserTb;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
public interface ExamRe extends JpaRepository<Exam,Long>, JpaSpecificationExecutor<Exam> {
    @Query("select e from Exam e where e.trainingPlan.id= ?1")
    List<Exam> findByTrainPlanId(Long id);

    List<Exam> findAllByOrganization(Organization organization);
}
